//
//  NewKuaiJiePayViewController.m
//  wangzhe
//
//  Created by 李 佳伟 on 2018/3/26.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "NewKuaiJiePayViewController.h"
#import "JTCSM.h"
#import "MyDoubleLabelView.h"
#import "NewPayFinishViewController.h"

@interface NewKuaiJiePayViewController ()

@property (nonatomic,strong) MyDoubleLabelView *headerDoubleView;

@property (nonatomic,strong) UITextField *yanzhengmaTextfield;
@property (nonatomic,strong) UILabel  *phonenumberLabel;

@end

@implementation NewKuaiJiePayViewController
- (void)gotBack{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = NO;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [df isRemoveTarbar:YES];
    self.navigationController.navigationBar.hidden = NO;
    self.view.backgroundColor =RGBACOLOR(241, 241, 241, 1);
    leftBarButtonItems_rightBarButtonItems *leftbtn = KCUSTOMNAVIGSTION_ALLOC;
    self.navigationItem.leftBarButtonItem = [leftbtn setBarButtonItemsImageName:@"fanhui.png" frame:KLeftBarButtonItemFrame_image target:self SEL:@selector(gotBack)];
    [self layoutSubview];
}

- (void)layoutSubview{
    
    UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, KagainChangeHeight, KCONTROLLERWith, 115)];
    headerView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:headerView];
    headerView.userInteractionEnabled = YES;
    
    self.headerDoubleView = [[MyDoubleLabelView alloc]initWithFrame:CGRectMake(20, 0, KCONTROLLERWith-40, headerView.LC_height) leftTitleFontsize:14 titlecolor:[df colorWithHexString:@"999999" alpha:1] contentFontsize:36 contentcolor:[df colorWithHexString:@"333333" alpha:1]];
    [headerView addSubview:self.headerDoubleView];
    
    UIView *titleView = [[UIView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(headerView), KCONTROLLERWith, 40)];
    titleView.backgroundColor = RGBACOLOR(241, 241, 241, 1);
    [self.view addSubview:titleView];
    CGFloat imagesize = 20;
    UIImageView *imagev =[[UIImageView alloc]initWithFrame:CGRectMake(20, 10, imagesize, imagesize)];
    imagev.image = [UIImage imageNamed:@"钱包充值!.png"];
    [titleView addSubview:imagev];
    
    UILabel *titleLabel = [UILabel initWithFrame:CGRectMake(KVIEW_X(imagev)+10, imagev.LC_y, KCONTROLLERWith-40, imagesize) text:@"请输入银行卡预留信息" font:12 textAlignment:NSTextAlignmentLeft texcolor:[df colorWithHexString:@"666666" alpha:1] backgroundColor:nil];
    [titleView addSubview:titleLabel];
    
    CGFloat labelHeight = 50;
    
    UIView *bottomView=[[UIView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(titleView), KCONTROLLERWith, labelHeight*2)];
    bottomView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:bottomView];
    bottomView.userInteractionEnabled = YES;
    
    NSString *yanzhengmaTitle = @"请输入6位验证码";
    CGFloat font = 14;
    CGRect rect = [df labelHeightWithContent:yanzhengmaTitle height:labelHeight font:font];
    
    UILabel *phonetitleLabel = [UILabel initWithFrame:CGRectMake(20, 0, rect.size.width, labelHeight) text:@"预留手机号" font:font textAlignment:NSTextAlignmentLeft texcolor:[df colorWithHexString:@"999999" alpha:1] backgroundColor:nil];
    [bottomView addSubview:phonetitleLabel];
    
    self.phonenumberLabel = [UILabel initWithFrame:CGRectMake(KVIEW_X(phonetitleLabel)+10, 0, KCONTROLLERWith-20-rect.size.width, labelHeight) text:@"133 **** 0395" font:14 textAlignment:NSTextAlignmentLeft texcolor:[df colorWithHexString:@"333333" alpha:1] backgroundColor:nil];
    [bottomView addSubview:self.phonenumberLabel];
    
    [df newlineViewWithHeightofTop:labelHeight superView:bottomView spacing:0 color:RGBACOLOR(241, 241, 241, 1) lineHeight:1];
    
    UILabel *yanzhengmatitleLabel = [UILabel initWithFrame:CGRectMake(20, labelHeight, rect.size.width, labelHeight) text:yanzhengmaTitle font:font textAlignment:NSTextAlignmentLeft texcolor:[df colorWithHexString:@"999999" alpha:1] backgroundColor:nil];
    [bottomView addSubview:yanzhengmatitleLabel];
    
    CGFloat buttonwidth = 80;
    CGFloat buttonHeight = 30;
    self.yanzhengmaTextfield = [UITextField initWithframe:CGRectMake(self.phonenumberLabel.LC_x, labelHeight, self.phonenumberLabel.LC_width-10-buttonwidth, labelHeight) backgrandColor:nil placeholder:@"" textAlignment:NSTextAlignmentLeft font:14 texcolor:[df colorWithHexString:@"333333" alpha:1]];
    [bottomView addSubview:self.yanzhengmaTextfield];
    
    UIButton *getKeyBtn = [UIButton initWithFrame:CGRectMake(KCONTROLLERWith-buttonwidth-10,labelHeight+(labelHeight-buttonHeight)/2, buttonwidth, buttonHeight) backgrandColor:nil titleColor:RGBACOLOR(89, 89, 89, 1 ) title:@"获取验证码" titleFont:12];
    [getKeyBtn addTarget:self action:@selector(getToKey) forControlEvents:UIControlEventTouchUpInside];
    [bottomView addSubview:getKeyBtn];
    [df layerWithView:getKeyBtn radius:15 width:1 color:KZhuTiRGB];
    
    
    
    NSString *string = @"同意《信用卡还款服务协议》";
    float xieyifont = 12;
    CGFloat xieyilabelHeight = 30;
    CGRect xieyirect = [df labelHeightWithContent:string height:xieyilabelHeight font:xieyifont];
    CGFloat btnimagesize = xieyirect.size.height;
    CGFloat changesize = 10;
    UIButton * leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
    leftButton.frame = CGRectMake(20, KVIEW_Y(bottomView)+20, xieyirect.size.width+btnimagesize+changesize, xieyilabelHeight);
    [leftButton setImage:[UIImage imageNamed:@"btn_02.png"] forState:UIControlStateNormal];
    [leftButton setImage:[UIImage imageNamed:@"btn_01.png"] forState:UIControlStateSelected];
    [leftButton addTarget:self  action:@selector(saveloginInfo:) forControlEvents:UIControlEventTouchUpInside];
    [leftButton setTitle:string forState:UIControlStateNormal];
    [leftButton.titleLabel setFont:[UIFont systemFontOfSize:xieyifont]];
    leftButton.imageEdgeInsets = UIEdgeInsetsMake((xieyilabelHeight-btnimagesize)/2, 0, (xieyilabelHeight-btnimagesize)/2, xieyirect.size.width+changesize);
    leftButton.titleEdgeInsets = UIEdgeInsetsMake(0, -btnimagesize+changesize, 0, 0);
    [leftButton setTitleColor:RGBACOLOR(100, 100, 100, 1) forState:UIControlStateNormal];
    [self.view addSubview:leftButton];
    
    UIButton *tijiaobutton = [UIButton buttonWithType:UIButtonTypeCustom];
    tijiaobutton.frame = CGRectMake(25, KVIEW_Y(leftButton)+20, KCONTROLLERWith-40, 50);
    [tijiaobutton addTarget:self action:@selector(tijiao) forControlEvents:UIControlEventTouchUpInside];
    [df layerWithView:tijiaobutton radius:25 width:0 color:nil];
    tijiaobutton.backgroundColor = KZhuTiRGB;
    [tijiaobutton setTitleColor:RGBACOLOR(51, 51, 51, 1) forState:UIControlStateNormal];
    [tijiaobutton setTitle:@"确认支付" forState:UIControlStateNormal];
    [self.view addSubview:tijiaobutton];
    
    
    
}
-(void)getToKey{
    
}
-(void)saveloginInfo:(UIButton *)sender{
    
}
-(void)tijiao{
    NewPayFinishViewController *vc = [[NewPayFinishViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
